<?php include("../safe.php");
$user_name=$_SESSION["managername"];
$platform=$_REQUEST["platform"];
if($_REQUEST[lang]==""||!isset($_REQUEST[lang])){$lang="products";}else{$lang=$_REQUEST["lang"];}
if(empty($platform)){$platform="AliExpress";}
if($_SESSION["thetype"]=="超级管理员"){$result=mysqli_query($conn,"select * from ph_bcategory where platform='".$platform."' order by ID desc");}
if($_SESSION["thetype"]=="管理员"){
$query="select admin from ph_admin where admin='".$user_name."' or parent='".$user_name."'";
$resulty=mysqli_query($conn,$query);
$array=array();
while($rowy = mysqli_fetch_array($resulty)){
array_push($array,"'".$rowy[admin]."'");
}
$alluser=implode(',', $array);
$result=mysqli_query($conn,"select * from ph_bcategory where user_name in(".$alluser.") and platform='".$platform."' order by ID desc");
}
if($_SESSION["thetype"]=="员工"){
$result=mysqli_query($conn,"select * from ph_bcategory where  user_name='".$user_name."' and platform='".$platform."' order by ID desc");
}
$sqlm="select * from ph_lang order by id asc";
$resultm=mysqli_query($conn,$sqlm);
//print_r("select * from ph_bcategory where user_name in(".$alluser.") order by ID desc");
?> 
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
<title><?php echo $site_name;?>后台管理</title>
<link href="../bootstrap/css/bootstrap.min.css" title="" rel="stylesheet" />
<link href="../css/mcommon.css" rel="stylesheet" title="" type="text/css" />
<link href="../css/style.css" rel="stylesheet" type="text/css"  />
<link rel="shortcut icon" href="/logo.ico" />
<script language="javascript">
<!--
function CheckAll(form)
{
  for (var i=0;i<form.elements.length;i++)
  {
  var e = form.elements[i];
  if (e.Name != "chkAll"&&e.disabled!=true)
  e.checked = form.chkAll.checked;
  }
}
//-->
</script>
</head>

<body>
<!--顶部-->
<?php include("../top.php");?> 
<!--顶部结束--->
<!--主体部分-->
<div class="down-main">
	<!--左侧部分-->
  <?php include("../left.php");?> 
  <!--左侧部分结束-->
  <!--右侧部分-->
  <div class="right-product right-full">
  	<!--右侧内容部分-->
    <div class="container-fluid right-product-con">
    	<div class="mianbaoxie"><i class="glyphicon-folder-open glyphicon"></i>
    		<span>管理中心</span>&gt;<span class="dangqian">产品管理</span>    	</div>
      <div class="container-con">
      		<!--表格-->
      		<div class="tableCon">
			<div class="tableCon-tit clear">产品分类列表</div>
	      		<div class="tableCon-content">
				<table width="98%" border="0" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC" class="wenzi">
      <tr>
        <td height="20" colspan="4" bgcolor="#DAEDED">
            <form action="bigcategory.php?platform=<?php echo $platform;?>" method="post" name="form2" id="form2" class="form-inline">
                选择语种：
                  <select name="lang" id="lang" class="form-control">
                    <?php 
					if(!empty($lang)){
					$sqlls="select *from ph_lang where lanid='".$lang."'";
					$resultts=mysqli_query($conn,$sqlls);
					if(mysqli_num_rows($resultts)>=1){
					$rowtls=mysqli_fetch_array($resultts);
					echo '<option value="'.$rowtls["lanid"].'">'.$rowtls["lang"].'</option>';
					}
					}
					?>
					<option value="products">默认语言</option>
                    <?php while($rowm=mysqli_fetch_array($resultm)){?>
                    <option value="<?php echo $rowm["lanid"];?>"><?php echo $rowm["lang"];?></option>
                    <?php }?>
                    </select>
                
                  <input  value="查询" type="submit"  class="btn btn-success form-control"/></form>
      </td>
      </tr>
      <form id="form1" name="form1" method="post" action="bigcategory_save.php?action=del&platform=<?php echo $platform;?>">
      <tr>
        <td height="20" bgcolor="#FFFFFF"><div align="center">序号</div></td>
        <td bgcolor="#FFFFFF"><div align="left">分类名称</div></td>
        <td bgcolor="#FFFFFF"><div align="left">创建用户</div></td>
        <td bgcolor="#FFFFFF"><div align="left">操作</div></td>
      </tr>
  <?php while($row=mysqli_fetch_array($result)){?>
      <tr>
        <td height="20" bgcolor="#F7F7F7"><div align="center">
          <input name="id[]" type="checkbox" id="id[]" value="<?php echo $row["ID"];?>" />
        </div></td>
        <td bgcolor="#F7F7F7"><div align="left"><a href="../products/productslist.php?bname=<?php echo $row["bname"];?>&lang=<?php echo $lang;?>&platform=<?php echo $platform;?>"><?php echo $row["bname"];?></a></div></td>
        <td bgcolor="#F7F7F7"><div align="left"><?php echo $row["user_name"];?></div></td>
        <td bgcolor="#F7F7F7"><div align="left"><a style="margin-bottom:5px;" class="btn btn-danger" role="button" href="bigcategory_save.php?action=del&id=<?php echo $row["ID"];?>&platform=<?php echo $platform;?>">删除</a> <a class="btn btn-success" role="button" href="outexcel.php?bname=<?php echo $row["bname"];?>&lang=<?php echo $lang;?>&platform=<?php echo $platform;?>" style="margin-bottom:5px;">导出精简亚马逊美国UPC表</a> <a style="margin-bottom:5px;" class="btn btn-success" role="button" href="outexcelset_us.php?bname=<?php echo $row["bname"];?>&lang=<?php echo $lang;?>&platform=<?php echo $platform;?>">导出亚马逊美国UPC表</a> <a style="margin-bottom:5px;" class="btn btn-success" role="button" href="outexcelset_jp.php?bname=<?php echo $row["bname"];?>&lang=<?php echo $lang;?>&platform=<?php echo $platform;?>">导出亚马逊日本UPC表</a> <a style="margin-bottom:5px;" class="btn btn-success" role="button" href="outexcelset.php?bname=<?php echo $row["bname"];?>&lang=<?php echo $lang;?>&platform=<?php echo $platform;?>" target="_blank">导出亚马逊欧洲EAN表</a> <a style="margin-bottom:5px;" class="btn btn-success" role="button" href="outdunhuangset.php?bname=<?php echo $row["bname"];?>&lang=<?php echo $lang;?>&platform=<?php echo $platform;?>" target="_blank">导出敦煌网格式Excel表</a> <a style="margin-bottom:5px;" class="btn btn-success" role="button" href="outerpset.php?bname=<?php echo $row["bname"];?>&lang=<?php echo $lang;?>&platform=<?php echo $platform;?>" target="_blank">导出ERP Excel格式</a><!--<a style="margin-bottom:5px;" class="btn btn-info" role="button" href="resize.php?bname=<?php echo $row["bname"];?>&lang=<?php echo $lang;?>&platform=<?php echo $platform;?>">批量修改图片尺寸</a> <a style="margin-bottom:5px;" class="btn btn-warning" role="button" href="/products/imglist.php?bname=<?php echo $row["bname"];?>&lang=<?php echo $lang;?>&platform=<?php echo $platform;?>">产品图片管理</a>--> <a style="margin-bottom:5px;" class="btn btn-success" role="button" href="replace.php?bname=<?php echo $row["bname"];?>&lang=<?php echo $lang;?>&platform=<?php echo $platform;?>" target="_blank">批量替换字符</a> <a style="margin-bottom:5px;" class="btn btn-success" role="button" href="zhuanyi.php?id=<?php echo $row["ID"];?>&lang=<?php echo $lang;?>&platform=<?php echo $platform;?>" target="_blank">转移</a></div></td>
      </tr>
  <?php }?>
      <tr>
        <td bgcolor="#F7F7F7">&nbsp;</td>
        <td height="20" colspan="3" bgcolor="#F7F7F7"><div align="left">全选
          <input name="chkAll" type="checkbox" id="chkAll" onClick="CheckAll(this.form)" value="checkbox" /><input value="删除选中" type="submit" class="btn btn-danger"/>
          <a class="btn btn-success" role="button" href="bigcategory_add.php?platform=<?php echo $platform;?>">新增分类</a></div></td>
      </tr>
    </form>
  </table>
	      		</div>
	      	</div>
	      	<!--表格结束--->
      	</div>
      </div>
  </div>
	  <!--右侧内容部分结束-->
  </div>
  <!--右侧部分结束-->
</div>
<!--主体部分结束-->
<script src="../js/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="../bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="../js/mcommon.js"></script>
</body>
</html>
